feat: support lts releases in linux#13
Conversation
feat: support lts releases in linux
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for LTS (Long Term Support) PHP releases on Linux by incorporating the downloads page as an additional source for version information. Previously, only versions from the releases page were available, which excluded current LTS versions.
- Restructured URL constants to support both standard releases and LTS downloads pages
- Updated Linux version discovery to check both releases and downloads pages
- Modified Windows release handling to use renamed constants
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/constants.lua | Restructured URL constants to separate standard and LTS release URLs |
| hooks/pre_install.lua | Updated Windows release URL references to use renamed constants |
| hooks/available.lua | Enhanced Linux version discovery to fetch from both releases and downloads pages |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| local versionStr = is_from_lts and selection:attr("id") or selection:text() | ||
| versionStr = versionStr:gsub("^v", "") |
There was a problem hiding this comment.
The conditional logic for extracting version strings is unclear. Consider extracting this into separate functions for LTS and standard release parsing to improve readability and maintainability.
|
|
||
| if resp then | ||
| local doc = html.parse(resp.body) | ||
| local query = "#layout-content " .. (is_from_lts and "h3" or "h2") |
There was a problem hiding this comment.
The CSS selector construction using string concatenation with conditional logic makes the code harder to understand. Consider defining separate constants for the selectors or extracting this into a helper function.
It was unable to install LTS versions of PHP because it was not listed in https://www.php.net/releases/, which only includes "Unsupported Historical Releases".
This PR adds https://www.php.net/downloads.php as the source of versions to support LTS versions.